Optimal. Leaf size=366 \[ \frac {b \sin (c+d x) \left (2 a^2 B (m+4)+3 a A b (m+3)+b^2 B (m+2)\right ) \sec ^{m+1}(c+d x)}{d (m+1) (m+3)}-\frac {\sin (c+d x) \left (a^3 A \left (m^2+4 m+3\right )+3 a^2 b B m (m+3)+3 a A b^2 m (m+3)+b^3 B m (m+2)\right ) \sec ^{m-1}(c+d x) \, _2F_1\left (\frac {1}{2},\frac {1-m}{2};\frac {3-m}{2};\cos ^2(c+d x)\right )}{d (m+3) \left (1-m^2\right ) \sqrt {\sin ^2(c+d x)}}+\frac {\sin (c+d x) \left (a^3 B (m+2)+3 a^2 A b (m+2)+3 a b^2 B (m+1)+A b^3 (m+1)\right ) \sec ^m(c+d x) \, _2F_1\left (\frac {1}{2},-\frac {m}{2};\frac {2-m}{2};\cos ^2(c+d x)\right )}{d m (m+2) \sqrt {\sin ^2(c+d x)}}+\frac {b^2 \sin (c+d x) (a B (m+5)+A b (m+3)) \sec ^{m+2}(c+d x)}{d (m+2) (m+3)}+\frac {b B \sin (c+d x) \sec ^{m+1}(c+d x) (a+b \sec (c+d x))^2}{d (m+3)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.79, antiderivative size = 366, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {4026, 4076, 4047, 3772, 2643, 4046} \[ -\frac {\sin (c+d x) \left (a^3 A \left (m^2+4 m+3\right )+3 a^2 b B m (m+3)+3 a A b^2 m (m+3)+b^3 B m (m+2)\right ) \sec ^{m-1}(c+d x) \, _2F_1\left (\frac {1}{2},\frac {1-m}{2};\frac {3-m}{2};\cos ^2(c+d x)\right )}{d (m+3) \left (1-m^2\right ) \sqrt {\sin ^2(c+d x)}}+\frac {\sin (c+d x) \left (3 a^2 A b (m+2)+a^3 B (m+2)+3 a b^2 B (m+1)+A b^3 (m+1)\right ) \sec ^m(c+d x) \, _2F_1\left (\frac {1}{2},-\frac {m}{2};\frac {2-m}{2};\cos ^2(c+d x)\right )}{d m (m+2) \sqrt {\sin ^2(c+d x)}}+\frac {b \sin (c+d x) \left (2 a^2 B (m+4)+3 a A b (m+3)+b^2 B (m+2)\right ) \sec ^{m+1}(c+d x)}{d (m+1) (m+3)}+\frac {b^2 \sin (c+d x) (a B (m+5)+A b (m+3)) \sec ^{m+2}(c+d x)}{d (m+2) (m+3)}+\frac {b B \sin (c+d x) \sec ^{m+1}(c+d x) (a+b \sec (c+d x))^2}{d (m+3)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2643
Rule 3772
Rule 4026
Rule 4046
Rule 4047
Rule 4076
Rubi steps
\begin {align*} \int \sec ^m(c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx &=\frac {b B \sec ^{1+m}(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{d (3+m)}+\frac {\int \sec ^m(c+d x) (a+b \sec (c+d x)) \left (a (b B m+a A (3+m))+\left (b^2 B (2+m)+a (2 A b+a B) (3+m)\right ) \sec (c+d x)+b (A b (3+m)+a B (5+m)) \sec ^2(c+d x)\right ) \, dx}{3+m}\\ &=\frac {b^2 (A b (3+m)+a B (5+m)) \sec ^{2+m}(c+d x) \sin (c+d x)}{d (2+m) (3+m)}+\frac {b B \sec ^{1+m}(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{d (3+m)}+\frac {\int \sec ^m(c+d x) \left (a^2 (2+m) (b B m+a A (3+m))+(3+m) \left (A b^3 (1+m)+3 a b^2 B (1+m)+3 a^2 A b (2+m)+a^3 B (2+m)\right ) \sec (c+d x)+b (2+m) \left (b^2 B (2+m)+3 a A b (3+m)+2 a^2 B (4+m)\right ) \sec ^2(c+d x)\right ) \, dx}{6+5 m+m^2}\\ &=\frac {b^2 (A b (3+m)+a B (5+m)) \sec ^{2+m}(c+d x) \sin (c+d x)}{d (2+m) (3+m)}+\frac {b B \sec ^{1+m}(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{d (3+m)}+\frac {\int \sec ^m(c+d x) \left (a^2 (2+m) (b B m+a A (3+m))+b (2+m) \left (b^2 B (2+m)+3 a A b (3+m)+2 a^2 B (4+m)\right ) \sec ^2(c+d x)\right ) \, dx}{6+5 m+m^2}+\frac {\left ((3+m) \left (A b^3 (1+m)+3 a b^2 B (1+m)+3 a^2 A b (2+m)+a^3 B (2+m)\right )\right ) \int \sec ^{1+m}(c+d x) \, dx}{6+5 m+m^2}\\ &=\frac {b \left (b^2 B (2+m)+3 a A b (3+m)+2 a^2 B (4+m)\right ) \sec ^{1+m}(c+d x) \sin (c+d x)}{d (1+m) (3+m)}+\frac {b^2 (A b (3+m)+a B (5+m)) \sec ^{2+m}(c+d x) \sin (c+d x)}{d (2+m) (3+m)}+\frac {b B \sec ^{1+m}(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{d (3+m)}+\frac {\left (b^3 B m (2+m)+3 a A b^2 m (3+m)+3 a^2 b B m (3+m)+a^3 A \left (3+4 m+m^2\right )\right ) \int \sec ^m(c+d x) \, dx}{(1+m) (3+m)}+\frac {\left ((3+m) \left (A b^3 (1+m)+3 a b^2 B (1+m)+3 a^2 A b (2+m)+a^3 B (2+m)\right ) \cos ^m(c+d x) \sec ^m(c+d x)\right ) \int \cos ^{-1-m}(c+d x) \, dx}{6+5 m+m^2}\\ &=\frac {b \left (b^2 B (2+m)+3 a A b (3+m)+2 a^2 B (4+m)\right ) \sec ^{1+m}(c+d x) \sin (c+d x)}{d (1+m) (3+m)}+\frac {b^2 (A b (3+m)+a B (5+m)) \sec ^{2+m}(c+d x) \sin (c+d x)}{d (2+m) (3+m)}+\frac {b B \sec ^{1+m}(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{d (3+m)}+\frac {\left (A b^3 (1+m)+3 a b^2 B (1+m)+3 a^2 A b (2+m)+a^3 B (2+m)\right ) \, _2F_1\left (\frac {1}{2},-\frac {m}{2};\frac {2-m}{2};\cos ^2(c+d x)\right ) \sec ^m(c+d x) \sin (c+d x)}{d m (2+m) \sqrt {\sin ^2(c+d x)}}+\frac {\left (\left (b^3 B m (2+m)+3 a A b^2 m (3+m)+3 a^2 b B m (3+m)+a^3 A \left (3+4 m+m^2\right )\right ) \cos ^m(c+d x) \sec ^m(c+d x)\right ) \int \cos ^{-m}(c+d x) \, dx}{(1+m) (3+m)}\\ &=\frac {b \left (b^2 B (2+m)+3 a A b (3+m)+2 a^2 B (4+m)\right ) \sec ^{1+m}(c+d x) \sin (c+d x)}{d (1+m) (3+m)}+\frac {b^2 (A b (3+m)+a B (5+m)) \sec ^{2+m}(c+d x) \sin (c+d x)}{d (2+m) (3+m)}+\frac {b B \sec ^{1+m}(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{d (3+m)}-\frac {\left (b^3 B m (2+m)+3 a A b^2 m (3+m)+3 a^2 b B m (3+m)+a^3 A \left (3+4 m+m^2\right )\right ) \, _2F_1\left (\frac {1}{2},\frac {1-m}{2};\frac {3-m}{2};\cos ^2(c+d x)\right ) \sec ^{-1+m}(c+d x) \sin (c+d x)}{d (1-m) (1+m) (3+m) \sqrt {\sin ^2(c+d x)}}+\frac {\left (A b^3 (1+m)+3 a b^2 B (1+m)+3 a^2 A b (2+m)+a^3 B (2+m)\right ) \, _2F_1\left (\frac {1}{2},-\frac {m}{2};\frac {2-m}{2};\cos ^2(c+d x)\right ) \sec ^m(c+d x) \sin (c+d x)}{d m (2+m) \sqrt {\sin ^2(c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 2.56, size = 307, normalized size = 0.84 \[ \frac {\sqrt {-\tan ^2(c+d x)} \csc (c+d x) \sec ^{m-1}(c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \left (\frac {a^3 A \cos ^4(c+d x) \, _2F_1\left (\frac {1}{2},\frac {m}{2};\frac {m+2}{2};\sec ^2(c+d x)\right )}{m}+\frac {a^2 (a B+3 A b) \cos ^3(c+d x) \, _2F_1\left (\frac {1}{2},\frac {m+1}{2};\frac {m+3}{2};\sec ^2(c+d x)\right )}{m+1}+b \left (\frac {3 a (a B+A b) \cos ^2(c+d x) \, _2F_1\left (\frac {1}{2},\frac {m+2}{2};\frac {m+4}{2};\sec ^2(c+d x)\right )}{m+2}+b \left (\frac {(3 a B+A b) \cos (c+d x) \, _2F_1\left (\frac {1}{2},\frac {m+3}{2};\frac {m+5}{2};\sec ^2(c+d x)\right )}{m+3}+\frac {b B \, _2F_1\left (\frac {1}{2},\frac {m+4}{2};\frac {m+6}{2};\sec ^2(c+d x)\right )}{m+4}\right )\right )\right )}{d (a \cos (c+d x)+b)^3 (A \cos (c+d x)+B)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 0.80, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (B b^{3} \sec \left (d x + c\right )^{4} + A a^{3} + {\left (3 \, B a b^{2} + A b^{3}\right )} \sec \left (d x + c\right )^{3} + 3 \, {\left (B a^{2} b + A a b^{2}\right )} \sec \left (d x + c\right )^{2} + {\left (B a^{3} + 3 \, A a^{2} b\right )} \sec \left (d x + c\right )\right )} \sec \left (d x + c\right )^{m}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \sec \left (d x + c\right ) + A\right )} {\left (b \sec \left (d x + c\right ) + a\right )}^{3} \sec \left (d x + c\right )^{m}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 1.99, size = 0, normalized size = 0.00 \[ \int \left (\sec ^{m}\left (d x +c \right )\right ) \left (a +b \sec \left (d x +c \right )\right )^{3} \left (A +B \sec \left (d x +c \right )\right )\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \sec \left (d x + c\right ) + A\right )} {\left (b \sec \left (d x + c\right ) + a\right )}^{3} \sec \left (d x + c\right )^{m}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int \left (A+\frac {B}{\cos \left (c+d\,x\right )}\right )\,{\left (a+\frac {b}{\cos \left (c+d\,x\right )}\right )}^3\,{\left (\frac {1}{\cos \left (c+d\,x\right )}\right )}^m \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (A + B \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{3} \sec ^{m}{\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________